from django.db import models

# Create your models here.
class manufacturer(models.Model):
    manname=models.CharField(max_length=100,verbose_name='厂商名称')

    class Meta:
        db_table = 'tb_manufacturer'

class Car(models.Model):
    carname=models.CharField(max_length=100,verbose_name='汽车型号')
    carprice=models.IntegerField(verbose_name='售价')
    carcolor=models.CharField(max_length=100,verbose_name='颜色')
    carman=models.ForeignKey(manufacturer,on_delete=models.CASCADE,verbose_name='厂商')

    class Meta:
        db_table = 'tb_car'

class commodity(models.Model):
    comname=models.CharField(max_length=100,verbose_name='商品名称')
    comprice=models.IntegerField(verbose_name='商品价格')
    comnum=models.IntegerField(verbose_name='商品数量')
    comimg=models.ImageField(upload_to='comimg',verbose_name='商品图片')

    class Meta:
        db_table = 'tb_commodity'




